import pandas as pd
import numpy as np

print("=== 分析A题数据 ===\n")

# 读取附件数据
print("1. 读取附件.xlsx数据：")
try:
    # 读取所有工作表
    xl = pd.ExcelFile('附件.xlsx')
    print(f"工作表名称: {xl.sheet_names}")
    
    for sheet_name in xl.sheet_names:
        df = pd.read_excel('附件.xlsx', sheet_name=sheet_name)
        print(f"\n--- {sheet_name} ---")
        print(f"数据形状: {df.shape}")
        print("前几行数据:")
        print(df.head())
        print("数据类型:")
        print(df.dtypes)
        
except Exception as e:
    print(f"读取附件时出错: {e}")

print("\n" + "="*50 + "\n")

# 读取结果文件
for result_file in ['result2.xlsx', 'result3.xlsx']:
    print(f"2. 读取{result_file}数据：")
    try:
        xl_result = pd.ExcelFile(result_file)
        print(f"工作表名称: {xl_result.sheet_names}")
        
        for sheet_name in xl_result.sheet_names:
            df_result = pd.read_excel(result_file, sheet_name=sheet_name)
            print(f"\n--- {sheet_name} ---")
            print(f"数据形状: {df_result.shape}")
            print("前几行数据:")
            print(df_result.head())
            
    except Exception as e:
        print(f"读取{result_file}时出错: {e}")
    
    print("\n" + "="*30 + "\n") 